extends Node
class_name State;

var actor: Node
var state_machine:State_Machine
signal Transitioned(from:String,to:String)

func _ready() -> void:
	# 等待父节点（StateMachine）设置 actor 引用
	await owner.ready
	# 断言 actor 已经被设置，否则状态无法正常工作
	assert(actor != null, "The actor reference was not set for the state.")

func Enter() -> void:
	pass

	
func Exit() -> void:
	pass
		

func Update(_delta:float) -> void:
	pass	

func Physic_Update(_delta:float) -> void:
	pass

func transition_to(target_state_name: String):
	Transitioned.emit(self.name, target_state_name)
